package com.ext.springcloud.dao;

import com.ext.springcloud.entity.Account;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;

@Repository
@Mapper
public interface AccountDao {

    /**
     * 添加账户信息
     * @param account 账户信息
     * @return
     */
    Integer insertAccount(Account account);

    /**
     * 扣减账户余额
     * @param userId 用户Id
     * @param money 花费金额
     */
    void decrease(@Param("userId") Long userId, @Param("money") BigDecimal money);

}
